cmake_minimum_required(VERSION 3.10.0)
project(chip8_c VERSION 0.1.0 LANGUAGES C)

find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})

add_executable(chip8_c main.c chip8.c)

target_link_libraries(chip8_c SDL2::SDL2main SDL2::SDL2 SDL2_ttf::SDL2_ttf m)

add_custom_command(TARGET chip8_c POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
        "${CMAKE_CURRENT_SOURCE_DIR}/arial.ttf"
        "$<TARGET_FILE_DIR:chip8_c>/arial.ttf"
    COMMENT "Copying arial.ttf to output directory"
)
